<template>
  <transition name="msgbox-fade">
      <div class="modal-box" v-show="visible" @click="close()">
        <div class="img-out">
        <img :src="imgData" style="width:100%">
        </div>
      </div>
    </transition>
</template>
<script>
export default {
  data() {
    return {
      imgData: "",
      visible: true
    };
  },
  mounted() {
    console.log(this.imgData);
  },
  methods: {
    close() {
      this.visible = false;
    },
  },
  beforeDestroy() {
    setTimeout(() => {
      if (this.removeModal) {
        this.removeModal();
      }
    });
  }
};
</script>

<style lang="scss" scoped>
.modal-box {
  width: 100%;
  height: 100%;
  position: fixed;
  background: rgba(0, 0, 0, 0.8);
  top: 0;
  z-index: 2001;
  left: 0;
  .img-out {
    display: flex;
    align-items: center;
    height: 100%;
  }
}
</style>
